﻿
Imports System.Data.SqlClient
Public Class Backup_RestoreDuLieuBUS
    Public Shared Sub Backup(ByVal dulieu As String, ByVal path As String)
        Dim sqlparaPath As SqlParameter = New SqlParameter("path", SqlDbType.NVarChar)
        sqlparaPath.Direction = ParameterDirection.Input
        sqlparaPath.Value = path

        Dim sqlparaDuLieu As SqlParameter = New SqlParameter("database", SqlDbType.VarChar)
        sqlparaDuLieu.Direction = ParameterDirection.Input
        sqlparaDuLieu.Value = dulieu

        Backup_RestoreDuLieuDAO.Backup(sqlparaDuLieu, sqlparaPath)

    End Sub

    Public Shared Sub Restore(ByVal dulieu As String, ByVal path As String)
        Dim sqlparaPath As SqlParameter = New SqlParameter("path", SqlDbType.NVarChar)
        sqlparaPath.Direction = ParameterDirection.Input
        sqlparaPath.Value = path

        Dim sqlparaDuLieu As SqlParameter = New SqlParameter("database", SqlDbType.VarChar)
        sqlparaDuLieu.Direction = ParameterDirection.Input
        sqlparaDuLieu.Value = dulieu

        Backup_RestoreDuLieuDAO.Restore(sqlparaDuLieu, sqlparaPath)

    End Sub

End Class
